UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PbsN7zmhr09i9fKboc4tSVsynziJ/RQ+v8m0PSOsCbM='
WHERE
key_id = '515d196aa1338e996e62341b66e166e5d8d6dd946edbdc2c4cb2116e65308ed1'
AND (
token = 'PbsN7zmhr09i9fKboc4tSVsynziJ/RQ+v8m0PSOsCbM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)