UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YtrZnLZcXcd58Ter1oT+IFKJzxfM+ACheQdOS5lNIao='
WHERE
key_id = 'dbf48b40f515d5299ac0b9eec0396173762d9f779fe11c21a5fe6bbdc179cff2'
AND (
token = 'YtrZnLZcXcd58Ter1oT+IFKJzxfM+ACheQdOS5lNIao='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)