UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KWkfKC+4uqHoTHvimjlKOJjng6M7BMRUN5X5U2Gov3M='
WHERE
key_id = '846f741a7852f7c7c3a4b9a79862217f97ebcd0be71bcd0691d2e80fa3ce3268'
AND (
token = 'KWkfKC+4uqHoTHvimjlKOJjng6M7BMRUN5X5U2Gov3M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)