UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DLmfDXvutzt6sw96w8GOaoIO8zrBVbT+XO+0TGJjVKU=' 
WHERE 
  key_id = '6695bbc4f908ed1a641c33952a254f241680ad51336905e656e9f578534f76dd' 
  AND (
    token = 'DLmfDXvutzt6sw96w8GOaoIO8zrBVbT+XO+0TGJjVKU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019