UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Da4FBJ6RI4Y7ljO6sntavJUFrBAvY2vkAsE1pDpZnE='
WHERE
key_id = '5849549aab2f257b9b3a336a6a0c402548b4009921835807a6003fe683c89298'
AND (
token = '/Da4FBJ6RI4Y7ljO6sntavJUFrBAvY2vkAsE1pDpZnE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)