UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OGyibEM4ZjbDsGknzGqRbqp42lflpZ1prVkYdH/hYgA=' 
WHERE 
  key_id = '7ea78f80c2dcb4add0baac7d904c0e8b97afa1fcf8a457ee9238651d494f30d0' 
  AND (
    token = 'OGyibEM4ZjbDsGknzGqRbqp42lflpZ1prVkYdH/hYgA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035