UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g1OXo6jVhG6lWHp9XvEGDgjtGTL/FtRh6HjczKJu14w='
WHERE
key_id = '4e97db499ca03c6dbc29d6257f7ee306c53ba964e5dc9cd827df01e3519b28d3'
AND (
token = 'g1OXo6jVhG6lWHp9XvEGDgjtGTL/FtRh6HjczKJu14w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)