UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kUwcfr4/9mw/sjrj7hh/qTnctCJlhIoi2b62+2XN8YQ=' 
WHERE 
  key_id = '22fefa4ac23f8d67439be69fee711486e23051f9be05b3245009aeb4488a9e47' 
  AND (
    token = 'kUwcfr4/9mw/sjrj7hh/qTnctCJlhIoi2b62+2XN8YQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042