UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9V3j1MiDHLPE2yVQM0Dsqnvr2a0LE4PMKsPETVqku48='
WHERE
key_id = '3a8b7a0268c3eced2c793fd57cd416e77bbdfbd9ab6177fafc652d38125b1545'
AND (
token = '9V3j1MiDHLPE2yVQM0Dsqnvr2a0LE4PMKsPETVqku48='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)