UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd6hsUj9iCNR/oZvn/lR/5q00hTVyVEfZ2IkfVqB5gLE=' 
WHERE 
  key_id = '2cd95d5caa4d936d997424bc6612bb06813431dabb8380420befdb3d7a196f59' 
  AND (
    token = 'd6hsUj9iCNR/oZvn/lR/5q00hTVyVEfZ2IkfVqB5gLE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019