UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RTueyyrTFQn4JLXSsuwWWbGhgU78XStXF/fMXISfGHc='
WHERE
key_id = '30becf9aad3790fd54de1e086bc232be619c2c878ef154a4a9a7d4138ca15140'
AND (
token = 'RTueyyrTFQn4JLXSsuwWWbGhgU78XStXF/fMXISfGHc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)