UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CA5ZZg47Yv18O75ZzsBms1IcjMD/Pc1uquccLnr6bWo='
WHERE
key_id = 'e78d3e541d6403c565d46f160279e8b2fb7b0791b07927766e3beabdf2495fd3'
AND (
token = 'CA5ZZg47Yv18O75ZzsBms1IcjMD/Pc1uquccLnr6bWo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)