UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wOOGyKq/I0htrL1lJIO7TEwWDSzp+oWU7iJc/fiF38o='
WHERE
key_id = '99b5c36d09179e9f7c0ab0e864a6dd8e5daad1a947df901c58ff0554d606ceb1'
AND (
token = 'wOOGyKq/I0htrL1lJIO7TEwWDSzp+oWU7iJc/fiF38o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)