UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5S7ArPvDg+uEu1CGmKeAE7Zut1EeQWk2lP4uvC7Smpg='
WHERE
key_id = '5b27d2b59ac2428cb2405ad299f7f187e23238bd6cd2d697c6e161d6c36ff38c'
AND (
token = '5S7ArPvDg+uEu1CGmKeAE7Zut1EeQWk2lP4uvC7Smpg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)