UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1liX1zuyG78d27e5sZommUwFwDOcC53ePpiE3lO98Gc='
WHERE
key_id = 'd8fdd92e675393cad9c3816a9c825a762ebb1fe2163555844210587f8e57d713'
AND (
token = '1liX1zuyG78d27e5sZommUwFwDOcC53ePpiE3lO98Gc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)