UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EQF53X2qwgX8NsZmgv3/A0KBa7K+IlChUvOkxmlBSNI='
WHERE
key_id = 'f7fb06310033b81f53c36eb4caf2378c863a6bd1fa5ee03485aaabd2e2a450ae'
AND (
token = 'EQF53X2qwgX8NsZmgv3/A0KBa7K+IlChUvOkxmlBSNI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)