UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6G8c/CUEUG4ADgaaaHPjl2g/4NXwRXiHUaFaowchOb0='
WHERE
key_id = 'bdd70494616a951524af2bd4febe7dd501e971bca249087f8fd13b7e390eb89c'
AND (
token = '6G8c/CUEUG4ADgaaaHPjl2g/4NXwRXiHUaFaowchOb0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)