UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eSVR4qbSy1PgCtKVp/GU7wogwDonEVpKqAjhPOQzAAQ=' 
WHERE 
  key_id = 'a2eafa2dbf815e944dc5020714373f444108003b5a21cc9f1b828ae4f20300c5' 
  AND (
    token = 'eSVR4qbSy1PgCtKVp/GU7wogwDonEVpKqAjhPOQzAAQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053