UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6HaC7bVB+vHoWSkWU0YRswE9IWomKh32bLj8QWC0EU0='
WHERE
key_id = '28cc08a25c4a154847a498e812de9ef9e217f21c323564d82bd98527bfa84caf'
AND (
token = '6HaC7bVB+vHoWSkWU0YRswE9IWomKh32bLj8QWC0EU0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)