UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GxxxZQP/+XbdzWR4D2pWjFJNn9ebkTk8Ht70UxTUgr4='
WHERE
key_id = '48b81238be5a2512e518e9146f73a27418cbf2c6fa4951136ece5f28e5c6c6f2'
AND (
token = 'GxxxZQP/+XbdzWR4D2pWjFJNn9ebkTk8Ht70UxTUgr4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)