UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '02F8sQtCG0ffvSH9fFniMM9ZTCIxw0Vf+5EyNjh/dk8='
WHERE
key_id = '37a504f3c0b57a22a00fe0b5ef574c295b90d0cc5139284a24779d60ba2b61e4'
AND (
token = '02F8sQtCG0ffvSH9fFniMM9ZTCIxw0Vf+5EyNjh/dk8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)