UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9B75AvuPg2OTCu9tC7bq+1GLJZ5Twf4/QqG3ck1Fv04='
WHERE
key_id = 'cfe229be316016d8a6ad479296813b8d5d7b6e11bc451c43b7a073f896435322'
AND (
token = '9B75AvuPg2OTCu9tC7bq+1GLJZ5Twf4/QqG3ck1Fv04='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)