UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p9KylBL4L/WoNwQ7xDLiO1RgPEq4LHUX9Chikll/igM='
WHERE
key_id = '889e9755da228bd933e26179fd2935d48cffaf1a61543cc98bd15505939cb64d'
AND (
token = 'p9KylBL4L/WoNwQ7xDLiO1RgPEq4LHUX9Chikll/igM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)