UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XayRSTCwr663nr7usVqMdcw1KoVFmJg7YwyyT/IQBzY='
WHERE
key_id = 'e30da5c9a2c4cd551a5246647339176b49177bf7db880649f7a0e8644f591a76'
AND (
token = 'XayRSTCwr663nr7usVqMdcw1KoVFmJg7YwyyT/IQBzY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)