UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V69lpvlKWuDO19ArapWr8/BRaacJAooaLV6fWBUiaKA='
WHERE
key_id = 'cdc54784c4d73841f84d5483b282958124718053d778e277ee508a762cf0ec39'
AND (
token = 'V69lpvlKWuDO19ArapWr8/BRaacJAooaLV6fWBUiaKA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)