UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MIJhG+iaeosnD0OCiPgJn/7Ivgt6SF7mveBNRlgTsQo='
WHERE
key_id = 'b32eab791a452e37a0b77f9664d8d1d2b4cfa9758e2030b17b1bf15c25e95b63'
AND (
token = 'MIJhG+iaeosnD0OCiPgJn/7Ivgt6SF7mveBNRlgTsQo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)