UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lIqeJ3iicN1sSl8eTdKdnrwZlG6Q2PuYO8X9wNtW08o=' 
WHERE 
  key_id = '2d4d8d5c052ca322ee31b0cee351785653dcaad2d97b9f534efb5f6355e327aa' 
  AND (
    token = 'lIqeJ3iicN1sSl8eTdKdnrwZlG6Q2PuYO8X9wNtW08o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024