UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NL8eGxSsEjqGR/cIHgLw7RX2qGbeNdIbaqzDicbCeIU='
WHERE
key_id = 'b54e179501509b028fe440e2b86f8fd0e1b39b0f755b275e5b5f14ecc5c43777'
AND (
token = 'NL8eGxSsEjqGR/cIHgLw7RX2qGbeNdIbaqzDicbCeIU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)