UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4K32NlvvmJR97BlLyR4Q+UI9LpbeYWMkV0mBXabLfCE='
WHERE
key_id = '749f3d7eb2c295dff708943a0e360f6eb8f327f4627894120f8c2102c37625cb'
AND (
token = '4K32NlvvmJR97BlLyR4Q+UI9LpbeYWMkV0mBXabLfCE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)