UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DLE2F0Eigk9hNbDNed3mcOIv/xM55XPSXqpd8wS6UWw=' 
WHERE 
  key_id = '16763b48b204d7055d4b172dd3d213a89c3d9d14c540058236c34aeeb9be1e31' 
  AND (
    token = 'DLE2F0Eigk9hNbDNed3mcOIv/xM55XPSXqpd8wS6UWw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020