UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZW8Yt2D0qdod8RGR4wa/we7XtaPcXW8Lnxq19kgimrk='
WHERE
key_id = '80e48640e793087c3d15ee2403690541f3b9bfc414c30de99f2c32e470cc54fd'
AND (
token = 'ZW8Yt2D0qdod8RGR4wa/we7XtaPcXW8Lnxq19kgimrk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)