UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u3tjakR6vxmS0GvwfpwLMiaXY4pwEr5bSFkPlaVMcGo='
WHERE
key_id = '0ea5ffe46644159e610baab6d46765fcb431bcf2ab2e1488f55e7b2d879079be'
AND (
token = 'u3tjakR6vxmS0GvwfpwLMiaXY4pwEr5bSFkPlaVMcGo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)