UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vg/9ZV/+eniJsufXACnexcui/xLvZ+umSq1MgRLg1Xo='
WHERE
key_id = 'f0d10a2dc12f5514d1eee6d9bbdbe87fadea5632b602c010e68fe18c52de073e'
AND (
token = 'Vg/9ZV/+eniJsufXACnexcui/xLvZ+umSq1MgRLg1Xo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)