UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fAGtTYNRMjlB6WTLwpdePxxSylQQ5j7UboK8HcA8+S0='
WHERE
key_id = '09258003281f3f1c1c8e33dfc9b3cafcd4cdda1e7ec07c9c9dad4b79b663af22'
AND (
token = 'fAGtTYNRMjlB6WTLwpdePxxSylQQ5j7UboK8HcA8+S0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)