UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T3lZQb4GLeW4/Qm3aHqYebNnkzrBHUHxAyMsPlbzr+8=' 
WHERE 
  key_id = 'a2940ad00580a085ab221b79001932b217fbbebebb31b0f0e98a25ce2e74d57b' 
  AND (
    token = 'T3lZQb4GLeW4/Qm3aHqYebNnkzrBHUHxAyMsPlbzr+8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026