UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EbK3+uE2yok0Mu/lbx3Z5A6yywcnnvoLo1PdivI99Nk='
WHERE
key_id = '46276bab19cec2c9e58eeff3809ed0b2264f3ec4d8f9e84fc1382eca6013142c'
AND (
token = 'EbK3+uE2yok0Mu/lbx3Z5A6yywcnnvoLo1PdivI99Nk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)