UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8SDvoH+NzgQuKk1E3mkxVSkynrJy6eLnZGlKk8AzwJQ='
WHERE
key_id = '430b52fd0b446aafe3dee9330b60aec2fd40afcbd30dfafb030512f377d4a412'
AND (
token = '8SDvoH+NzgQuKk1E3mkxVSkynrJy6eLnZGlKk8AzwJQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)