UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NxKgsEJ8Za29khl7/tPYoxSNd1GLdh6fVe49twdKpyc='
WHERE
key_id = '068c46ba7d6fff0cf633a5fed22592cc0fcda2b0a3814cc1e94547f549f65968'
AND (
token = 'NxKgsEJ8Za29khl7/tPYoxSNd1GLdh6fVe49twdKpyc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)