UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v2/TY9uzmkKrCHU87u5XMhLn40rwzfSfKoexL8PmAUg='
WHERE
key_id = '20addecd6542a98e11b5f989a25955f9c8cda718400f543b4900fb50d39600fc'
AND (
token = 'v2/TY9uzmkKrCHU87u5XMhLn40rwzfSfKoexL8PmAUg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)