UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iaJsMw7Ywj5nya1812wfBnklNTfLhBglKNIQXnpTQTw='
WHERE
key_id = '9735304af649476383a8c75eb98fdcd3e425f1480dbdbdad753d124c5339afdc'
AND (
token = 'iaJsMw7Ywj5nya1812wfBnklNTfLhBglKNIQXnpTQTw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)