UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pmzm3Hhs4ae/kIyvNTPH4MX6uhhrZjIlJStGMMy5ptU='
WHERE
key_id = '0e0f734cd3655b2260a8b8596b156da99e0bf5ecea23912dbab48b0256dff3ad'
AND (
token = 'pmzm3Hhs4ae/kIyvNTPH4MX6uhhrZjIlJStGMMy5ptU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)