UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vk9zZcIsKixHtDSGWzA8cCAxJHVUu0oE6DVCYQMxo18=' 
WHERE 
  key_id = 'cca465f4bba0c6c79aa17025d5395af2106677baeab6bf4335a905cc92f45bda' 
  AND (
    token = 'Vk9zZcIsKixHtDSGWzA8cCAxJHVUu0oE6DVCYQMxo18=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033