UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pBvFMubv7XHxMT5wrtC5d1w35VIOzz/Tg16mRIWhsbU='
WHERE
key_id = 'e7bbfadec84504c8a9dc7ca46d2a92ec688247e3604d76590551ed205f23fd3c'
AND (
token = 'pBvFMubv7XHxMT5wrtC5d1w35VIOzz/Tg16mRIWhsbU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)