UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0ESgfbiNiF/Yv2Nq9T9Qr0yWYGA8WE7aG9l63kd6thM='
WHERE
key_id = '35b12d6a0aba597e69621d62823d8f06db82d5e452c972c2f9df8bcd71231390'
AND (
token = '0ESgfbiNiF/Yv2Nq9T9Qr0yWYGA8WE7aG9l63kd6thM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)