UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OhdrLyVRQLmmKVQoNWjC7MBTke+WkbzrdBlO8q8MND8='
WHERE
key_id = 'f7533e25c8b581fc3d61fe63fd920c6f207f19240a93de84c84edd30adf55ce3'
AND (
token = 'OhdrLyVRQLmmKVQoNWjC7MBTke+WkbzrdBlO8q8MND8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)