UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kH01pGoQ1zCnTR7LcMffqMAxxRoPf4uKFd7mnlmhLwI=' 
WHERE 
  key_id = '222b1a9dd44ddfe0965a906c34c49be8e4ee5b74ccb9bfca2433bec0bb1097be' 
  AND (
    token = 'kH01pGoQ1zCnTR7LcMffqMAxxRoPf4uKFd7mnlmhLwI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031