UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ohdsyfH4+l3B8WUOm2YE15wZxkp67FiOdk7od1/C2DM='
WHERE
key_id = '99e4e416df6e0eb473a6f469e857f29bae4621e364dec4e8dfe270d65a8a4ebc'
AND (
token = 'ohdsyfH4+l3B8WUOm2YE15wZxkp67FiOdk7od1/C2DM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)