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