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