UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ni6rXfIZnhCo7IVI/pQ7VnZWKotimfIbk8J3DCKGA7I='
WHERE
key_id = 'e46f2751c5744a2b8f76da9200fcf5c466f42f9a849b4591b21831743d5fa8cb'
AND (
token = 'Ni6rXfIZnhCo7IVI/pQ7VnZWKotimfIbk8J3DCKGA7I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)