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