UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '30SUqmbTbf8e3NTZMgErsMipGY/T/ugv1vaUZv7hC2o='
WHERE
key_id = '91640ae6a982eaaaea9c8c165ed35d5cb02c6c937c831ed6ba73ab86b5d6b2ab'
AND (
token = '30SUqmbTbf8e3NTZMgErsMipGY/T/ugv1vaUZv7hC2o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)