UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EqAroetIfb3MEWL8lO/nbmabb2TNQ2ZVdo0d8dwURb8=' 
WHERE 
  key_id = 'fd6d8273b43998f68697b6bec01b31f66e804be17378cfd4056cf6acfb4542f0' 
  AND (
    token = 'EqAroetIfb3MEWL8lO/nbmabb2TNQ2ZVdo0d8dwURb8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019