UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2D2yKnHIr+BD4EL3xAmlPQMjYIjGWDPcWIHQvpMCbX4='
WHERE
key_id = 'f0dc87cae7ed13b47f534e999d1fa89be99521f28ed565634c22b3ae76e955c3'
AND (
token = '2D2yKnHIr+BD4EL3xAmlPQMjYIjGWDPcWIHQvpMCbX4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)