UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KCu9M/YtRFuQj5/X0sCXaef3Tt+mVcfOoxjx9hit3lA=' 
WHERE 
  key_id = 'b5b55cdc4ea42a934e5a9af4f7419b352ea6ca8a67137c1cc387c2a60399613e' 
  AND (
    token = 'KCu9M/YtRFuQj5/X0sCXaef3Tt+mVcfOoxjx9hit3lA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027