UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0eQwrG+3/8Rm2x2JeXvQT1S42KqJbQZsH57zV0EpIf4=' 
WHERE 
  key_id = '56992fc408d03ea8f6b9d7e4779b641504a3b979ee5be742264a8368ca9de514' 
  AND (
    token = '0eQwrG+3/8Rm2x2JeXvQT1S42KqJbQZsH57zV0EpIf4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024