UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7t9rwwDFciic6+eHfcV9wEP30TVhm0c/HCkFxcr/lLw=' 
WHERE 
  key_id = '0d53f58c64e62321b7ceacf698d135679cc984587dcff5b0630c7e6ec066cf89' 
  AND (
    token = '7t9rwwDFciic6+eHfcV9wEP30TVhm0c/HCkFxcr/lLw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055